package com.greentravel.model;

import java.util.Date;

/**
 * 资讯实体类
 * 存储绿色出行相关的环保知识、政策法规资讯
 */
public class News {
    private int id; // 资讯ID
    private String title; // 标题
    private String content; // 内容
    private String category; // 分类（环保知识、政策法规等）
    private Date publishTime; // 发布时间
    private String source; // 来源

    // 默认构造方法
    public News() {
    }

    // 带参数的构造方法
    public News(int id, String title, String content, String category, Date publishTime, String source) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.category = category;
        this.publishTime = publishTime;
        this.source = source;
    }

    // getter和setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Override
    public String toString() {
        return "News{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", category='" + category + '\'' +
                ", publishTime=" + publishTime +
                ", source='" + source + '\'' +
                '}';
    }
}